# backend/schemas/user.py
from pydantic import BaseModel, EmailStr
from typing import Optional
import uuid  # 添加这行

class UserBase(BaseModel):
    email: EmailStr
    full_name: Optional[str] = None

class UserCreate(UserBase):
    password: str

class UserUpdate(UserBase):
    password: Optional[str] = None

# 修复UserOut
class UserOut(UserBase):
    id: uuid.UUID  # 改为UUID类型
    is_active: bool

    class Config:
        from_attributes = True

# 保留Token模型
class Token(BaseModel):
    access_token: str
    token_type: str = "bearer"

class TokenData(BaseModel):
    username: Optional[str] = None